// IndexApi.js 封装首页模块模块相关接口
import myaxios from '../MyAxios'
import BASEURL from '../BaseUrl'
const BMDURL = BASEURL.BMDURL

const IndexApi = {

    /** 查询所有美食模块 返回Promise对象 */
    queryfoots() {
        let url = BMDURL + "/indexs"
        return myaxios.get(url)
    },

    //通过id查询对应的美食模块信息
    queryCardId(id) {
        let url = BMDURL + "/indexs/id?id=" + id;
        return myaxios.get(url)
    },

    /** 查询所有美食推荐列表*/
    queryfootsList() {
        let url = BMDURL + "/indexa/za"
        return myaxios.get(url)
    },

    //获取火爆推荐列表信息
    queueHuoBaoList() {
        let url = BMDURL + "/indexs/centreone"
        return myaxios.get(url)
    },

    //通过id获取火爆推荐信息
    queueHuoBaoId(id) {
        let url = BMDURL + "/indexs/centreone/id?id=" + id;
        return myaxios.get(url)
    },


    //通过id获取新品上架信息
    queryTuiId(id) {
        let url = BMDURL + "/indexs/centretwo/id?id=" + id;
        return myaxios.get(url)
    },

    //获取新品上架列表信息
    queryNewProductlist() {
        let url = BMDURL + "/indexs/centretwo"
        return myaxios.get(url)
    },

    //获取饮品分类列表信息
    queryDrinkTypeList() {
        let url = BMDURL + "/indexs/centrethree"
        return myaxios.get(url)
    },


    //通过id获取饮品分类信息
    queryDrinkTypeId(id) {
        let url = BMDURL + "/indexs/centrethree/id?id=" + id;
        return myaxios.get(url)
    },

    //获取美食专题列表信息
    querySpecialList() {
        let url = BMDURL + "/indexs/centrefour"
        return myaxios.get(url)
    },

    //美食专题模糊查询
    searchSpecial(value) {
        let url = BMDURL + "/indexs/special/search?keyword=" + encodeURIComponent(value);
        return myaxios.get(url)
    },

    // 导航栏搜索页面 模糊查询
    search(value) {
        let url = BMDURL + "/indexcx/search?keyword=" + encodeURIComponent(value);
        return myaxios.get(url)
    },

    //获取美食专题列表信息
    querySearchList() {
        let url = BMDURL + "/indexcx/centremhcx"
        return myaxios.get(url)
    },


    //更多模块 模糊查询
    searchMore(value) {
        let url = BMDURL + "/indexa/more/search?keyword=" + encodeURIComponent(value);
        return myaxios.get(url)
    },








    /**
     * 通过姓名模糊查询演员列表
     * @param {Object} params 请求参数对象。例如： {name:'张'}
     * @return Promise
     */
    queryActorsName(params) {
        let url = BMDURL + "/movie-actors/name"
        return myaxios.post(url, params)
    },

    /**
     * 添加演员
     * @param {Object} params 参数对象。
     *  例如：{actorName:演员名称, actorAvatar:演员头像}
     * @return Promise
     */
    save(params) {
        let url = BMDURL + "/movie-actor/add"
        return myaxios.post(url, params)
    },

    /**
     * 删除演员
     * @param {Object} params 参数对象。  {id:演员id}
     * @return Promise
     */
    deleteActor(params) {
        let url = BMDURL + "/movie-actor/del"
        return myaxios.post(url, params)
    }

}
export default IndexApi;